home *** CD-ROM | disk | FTP | other *** search
/ Headbone Interactive / Headbone_Interactive_CD-ROM_Sampler_1995.iso / pc / demos / abf / snf / ysnf.dxr / 00133_celebration scripts.ls < prev    next >
Encoding:
Text File  |  1995-11-08  |  8.0 KB  |  264 lines

  1. on stretchSprites
  2.   global gvcHiddenObjs, gvFirstHiddenSprite
  3.   repeat while soundBusy(1)
  4.     repeat with viHidden = 1 to gvcHiddenObjs
  5.       checkForSTOP()
  6.       set vHiddenSprite to gvFirstHiddenSprite + (viHidden - 1)
  7.       set vDance to random(4)
  8.       if vDance = 1 then
  9.         stretchLeft(vHiddenSprite)
  10.         next repeat
  11.       end if
  12.       if vDance = 2 then
  13.         stretchRight(vHiddenSprite)
  14.         next repeat
  15.       end if
  16.       if vDance = 3 then
  17.         stretchUp(vHiddenSprite)
  18.         next repeat
  19.       end if
  20.       if vDance = 4 then
  21.         stretchDown(vHiddenSprite)
  22.       end if
  23.     end repeat
  24.   end repeat
  25. end
  26.  
  27. on stretchRight vSprite
  28.   set vOrigW to the width of sprite vSprite
  29.   set vDestH to the stageRight
  30.   set vCurH to the right of sprite vSprite
  31.   set vLeft to the left of sprite vSprite
  32.   set vTop to the top of sprite vSprite
  33.   set vBottom to the bottom of sprite vSprite
  34.   set vIncrement to 10
  35.   set the stretch of sprite vSprite to 1
  36.   set vLoops to 1
  37.   repeat while vCurH < vDestH
  38.     set vCurH to vCurH + (vIncrement * vLoops)
  39.     spriteBox(vSprite, vLeft, vTop, vCurH, vBottom)
  40.     updateStage()
  41.     set vLoops to vLoops + 1
  42.   end repeat
  43.   spriteBox(vSprite, vDestH - vOrigW, vTop, vDestH, vBottom)
  44.   updateStage()
  45.   set the stretch of sprite vSprite to 0
  46. end
  47.  
  48. on stretchLeft vSprite
  49.   set vOrigW to the width of sprite vSprite
  50.   set vDestH to the stageLeft
  51.   set vCurH to the left of sprite vSprite
  52.   set vRight to the right of sprite vSprite
  53.   set vTop to the top of sprite vSprite
  54.   set vBottom to the bottom of sprite vSprite
  55.   set vIncrement to 10
  56.   set the stretch of sprite vSprite to 1
  57.   set vLoops to 1
  58.   repeat while vCurH > vDestH
  59.     set vCurH to vCurH - (vIncrement * vLoops)
  60.     spriteBox(vSprite, vCurH, vTop, vRight, vBottom)
  61.     updateStage()
  62.     set vLoops to vLoops + 1
  63.   end repeat
  64.   spriteBox(vSprite, vDestH, vTop, vDestH + vOrigW, vBottom)
  65.   updateStage()
  66.   set the stretch of sprite vSprite to 0
  67. end
  68.  
  69. on stretchDown vSprite
  70.   set vOrigH to the height of sprite vSprite
  71.   set vDestV to the stageBottom
  72.   set vLeft to the left of sprite vSprite
  73.   set vRight to the right of sprite vSprite
  74.   set vTop to the top of sprite vSprite
  75.   set vCurV to the bottom of sprite vSprite
  76.   set vIncrement to 5
  77.   set the stretch of sprite vSprite to 1
  78.   set vLoops to 1
  79.   repeat while vCurV < vDestV
  80.     set vCurV to vCurV + (vIncrement * vLoops)
  81.     spriteBox(vSprite, vLeft, vTop, vRight, vCurV)
  82.     updateStage()
  83.     set vLoops to vLoops + 1
  84.   end repeat
  85.   spriteBox(vSprite, vLeft, vDestV - vOrigH, vRight, vDestV)
  86.   updateStage()
  87.   set the stretch of sprite vSprite to 0
  88. end
  89.  
  90. on stretchUp vSprite
  91.   set vOrigH to the height of sprite vSprite
  92.   set vDestV to the stageTop
  93.   set vLeft to the left of sprite vSprite
  94.   set vRight to the right of sprite vSprite
  95.   set vBottom to the bottom of sprite vSprite
  96.   set vCurV to the top of sprite vSprite
  97.   set vIncrement to 5
  98.   set the stretch of sprite vSprite to 1
  99.   set vLoops to 1
  100.   repeat while vCurV > vDestV
  101.     set vCurV to vCurV - (vIncrement * vLoops)
  102.     spriteBox(vSprite, vLeft, vCurV, vRight, vBottom)
  103.     updateStage()
  104.     set vLoops to vLoops + 1
  105.   end repeat
  106.   spriteBox(vSprite, vLeft, vDestV, vRight, vDestV + vOrigH)
  107.   updateStage()
  108.   set the stretch of sprite vSprite to 0
  109. end
  110.  
  111. on pulseSprites
  112.   global gvcHiddenObjs, gvFirstHiddenSprite
  113.   set vIncrement to 20
  114.   repeat while soundBusy(1)
  115.     repeat with viHidden = 1 to gvcHiddenObjs
  116.       checkForSTOP()
  117.       set vHiddenSprite to gvFirstHiddenSprite + (viHidden - 1)
  118.       set vOrigW to the width of sprite vHiddenSprite
  119.       set vOrigH to the height of sprite vHiddenSprite
  120.       set the stretch of sprite vHiddenSprite to 1
  121.       repeat with vPulses = 1 to 5
  122.         set the width of sprite vHiddenSprite to vOrigW + (vIncrement * vPulses)
  123.         set the height of sprite vHiddenSprite to vOrigH + (vIncrement * vPulses)
  124.         updateStage()
  125.       end repeat
  126.       repeat with vPulses = 1 to 5
  127.         set the width of sprite vHiddenSprite to vOrigW + (vIncrement * (6 - vPulses))
  128.         set the height of sprite vHiddenSprite to vOrigH + (vIncrement * (6 - vPulses))
  129.         updateStage()
  130.       end repeat
  131.       set the width of sprite vHiddenSprite to vOrigW
  132.       set the height of sprite vHiddenSprite to vOrigH
  133.       updateStage()
  134.       set the stretch of sprite vHiddenSprite to 0
  135.     end repeat
  136.   end repeat
  137. end
  138.  
  139. on colorSprites
  140.   global gvcHiddenObjs, gvFirstHiddenSprite, gvBackSprite, MATTE, TRANS
  141.   set vaColors to fArray(mnew, 6)
  142.   vaColors(mput, 1, 5)
  143.   vaColors(mput, 2, 35)
  144.   vaColors(mput, 3, 67)
  145.   vaColors(mput, 4, 180)
  146.   vaColors(mput, 5, 185)
  147.   vaColors(mput, 6, 235)
  148.   repeat while soundBusy(1)
  149.     repeat with viHidden = 1 to gvcHiddenObjs
  150.       checkForSTOP()
  151.       set vHiddenSprite to gvFirstHiddenSprite + (viHidden - 1)
  152.       set the ink of sprite vHiddenSprite to MATTE
  153.       set the foreColor of sprite vHiddenSprite to vaColors(mget, random(6))
  154.       updateStage()
  155.     end repeat
  156.     set the foreColor of sprite gvBackSprite to vaColors(mget, random(6))
  157.     updateStage()
  158.   end repeat
  159.   repeat with viHidden = 1 to gvcHiddenObjs
  160.     set vHiddenSprite to gvFirstHiddenSprite + (viHidden - 1)
  161.     set the foreColor of sprite vHiddenSprite to 255
  162.     set the ink of sprite vHiddenSprite to TRANS
  163.     set the foreColor of sprite gvBackSprite to 255
  164.   end repeat
  165.   vaColors(mdispose)
  166. end
  167.  
  168. on fillStageWithSprites
  169.   global gvcHiddenObjs, gvFirstHiddenSprite
  170.   repeat with viHidden = 1 to gvcHiddenObjs
  171.     set vHiddenSprite to gvFirstHiddenSprite + (viHidden - 1)
  172.     set the trails of sprite vHiddenSprite to 1
  173.   end repeat
  174.   repeat while soundBusy(1)
  175.     repeat with viHidden = 1 to gvcHiddenObjs
  176.       checkForSTOP()
  177.       set vHiddenSprite to gvFirstHiddenSprite + (viHidden - 1)
  178.       set vLocH to random(the stageRight - the stageLeft)
  179.       set vLocV to random(the stageBottom - the stageTop)
  180.       set the locH of sprite vHiddenSprite to vLocH
  181.       set the locV of sprite vHiddenSprite to vLocV
  182.       updateStage()
  183.     end repeat
  184.   end repeat
  185.   repeat with viHidden = 1 to gvcHiddenObjs
  186.     set vHiddenSprite to gvFirstHiddenSprite + (viHidden - 1)
  187.     set the trails of sprite vHiddenSprite to 0
  188.   end repeat
  189. end
  190.  
  191. on dropSprites
  192.   global gvcHiddenObjs, gvFirstHiddenSprite
  193.   set vDestV to the stageBottom
  194.   repeat with viHidden = 1 to gvcHiddenObjs
  195.     checkForSTOP()
  196.     set vHiddenSprite to gvFirstHiddenSprite + (viHidden - 1)
  197.     set vLoops to 1
  198.     set vfFaster to 0
  199.     repeat while the locV of sprite vHiddenSprite < vDestV
  200.       set the locV of sprite vHiddenSprite to the locV of sprite vHiddenSprite + vLoops
  201.       updateStage()
  202.       if vfFaster then
  203.         set vLoops to vLoops + 1
  204.         set vfFaster to 0
  205.         next repeat
  206.       end if
  207.       set vfFaster to 1
  208.     end repeat
  209.   end repeat
  210. end
  211.  
  212. on celebrate
  213.   global gvBackSprite, gvcHiddenObjs, gvFirstHiddenSprite, gvCharSprite, gvcYeaSounds, gvLabelSprite, DIR_SYM, SFX_EXT, IBM
  214.   set the timeoutScript to EMPTY
  215.   set vBWCastName to the name of cast the castNum of sprite gvBackSprite
  216.   if vBWCastName contains "S&F" then
  217.     set vColorCastName to chars(vBWCastName, 1, offset("1", vBWCastName) - 1) & "2.pic"
  218.   else
  219.     set vColorCastName to vBWCastName
  220.   end if
  221.   set vYeaPhrase to random(gvcYeaSounds)
  222.   set vFileName to "SnFYea" & string(vYeaPhrase) & SFX_EXT
  223.   puppetSound(vFileName)
  224.   updateStage()
  225.   animateChar(0, 0)
  226.   set the castNum of sprite gvBackSprite to the number of cast vColorCastName
  227.   updateStage()
  228.   wait(60)
  229.   if soundBusy(1) then
  230.     repeat while soundBusy(1)
  231.       checkForSTOP()
  232.     end repeat
  233.   end if
  234.   set vDance to random(5)
  235.   if the machineType = IBM then
  236.     repeat while vDance = 3
  237.       set vDance to random(5)
  238.     end repeat
  239.   end if
  240.   puppetSound("S&FWin" & vDance & SFX_EXT)
  241.   updateStage()
  242.   if vDance = 1 then
  243.     stretchSprites()
  244.   else
  245.     if vDance = 2 then
  246.       pulseSprites()
  247.     else
  248.       if vDance = 3 then
  249.         colorSprites()
  250.       else
  251.         if vDance = 4 then
  252.           fillStageWithSprites()
  253.           cleanUpStage()
  254.         else
  255.           if vDance = 5 then
  256.             dropSprites()
  257.           end if
  258.         end if
  259.       end if
  260.     end if
  261.   end if
  262.   wait(60)
  263. end
  264.